import Page from '../model/page.js';


export default class PageController {

    page(id) {
        return Page.findByPk(id);
    }

    pages(projectId) {
        return Page.findAll({
            // attributes: queryColumns,
            where: { projectId }
        });
    }

    async createPage(payload) {
        const page = await Page.create({
            name: payload.name,
            projectId: payload.projectId
        });
        return page.id;
    }

}
